<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=utf-8" errorPage="/error.jsp" isELIgnored="false" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://www.opensymphony.com/oscache" prefix="cache" %>
<%@ taglib uri="http://atleap.blandware.com/taglib" prefix="atleap" %>
<html:xhtml />

            <atleap:constants className="com.blandware.atleap.webapp.taglib.core.grid.util.FilterConditions" scope="page" />
            <atleap:form action="/grid/stringFilter.do" method="POST" validateOnSubmit="false">
                <table align=left cellpadding="0" cellspacing="0" border="0" width="90%" class="filter-table">
                    <tr>
                        <td colspan="3" align="right" class="filter-ErrorMessage" width="25%"><atleap:messages property="firstValue" /></td>
                    </tr>
                    <tr>
                        <td class="filter-FildName">
                            <c:choose>
                                <c:when test="${stringFilterForm.fieldKey != null}">
                                    <atleap:message key="${stringFilterForm.fieldKey}" />
                                </c:when>
                                <c:otherwise>
                                   <c:out value="${stringFilterForm.fieldName}" escapeXml="true" />
                                </c:otherwise>
                            </c:choose>
                        </td>
                        <td class="filter-condition">
                            <html:select property="firstCondition">
                                <html:option key="core.grid.filter.isNull" value="${pageScope.OBJECT_IS_NULL}" />
                                <html:option key="core.grid.filter.isNotNull" value="${pageScope.OBJECT_IS_NOT_NULL}" />
                                <html:option key="core.grid.filter.string.startsWith" value="${pageScope.STRING_STARTS_WITH}" />
                                <html:option key="core.grid.filter.string.contains" value="${pageScope.STRING_CONTAINS}" />
                                <html:option key="core.grid.filter.string.endsWith" value="${pageScope.STRING_ENDS_WITH}" />
                                <html:option key="core.grid.filter.equal" value="${pageScope.STRING_EQUAL}" />
                                <html:option key="core.grid.filter.notEqual" value="${pageScope.STRING_NOT_EQUAL}" />
                            </html:select>
                        </td>
                        <td class="filter-value">
                            <html:text property="firstValue"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="filter-logicCopula" align="center">
                            <html:select property ="logicCopula">
                                <html:option key="core.grid.filter.logicCopulaAnd" value="${pageScope.LOGIC_COPULA_AND}" />
                                <html:option key="core.grid.filter.logicCopulaOr" value="${pageScope.LOGIC_COPULA_OR}" />
                            </html:select>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" align="right" class="filter-ErrorMessage"><atleap:messages property="secondValue" /></td>
                    </tr>
                    <tr>
                       <td class="filter-FildName">
                            <c:choose>
                                <c:when test="${stringFilterForm.fieldKey != null}">
                                    <atleap:message key="${stringFilterForm.fieldKey}" />
                                </c:when>
                                <c:otherwise>
                                   <c:out value="${stringFilterForm.fieldName}" escapeXml="true" />
                                </c:otherwise>
                            </c:choose>
                        </td>
                        <td class="filter-condition">
                            <html:select property="secondCondition">
                                <html:option key="core.grid.filter.conditionNotSet" value="${pageScope.CONDITION_NOT_SET}" />
                                <html:option key="core.grid.filter.isNull" value="${pageScope.OBJECT_IS_NULL}" />
                                <html:option key="core.grid.filter.isNotNull" value="${pageScope.OBJECT_IS_NOT_NULL}" />
                                <html:option key="core.grid.filter.string.startsWith" value="${pageScope.STRING_STARTS_WITH}" />
                                <html:option key="core.grid.filter.string.contains" value="${pageScope.STRING_CONTAINS}" />
                                <html:option key="core.grid.filter.string.endsWith" value="${pageScope.STRING_ENDS_WITH}" />
                                <html:option key="core.grid.filter.equal" value="${pageScope.STRING_EQUAL}" />
                                <html:option key="core.grid.filter.notEqual" value="${pageScope.STRING_NOT_EQUAL}" />
                            </html:select>
                        </td>
                        <td align="left" class="filter-value">
                            <html:text property="secondValue"/>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" align="center" nowrap="nowrap">
                            <atleap:submit styleClass="button" onclick="if ( window.opener == null ) { window.close(); return false; }" style="width: 120px;"><atleap:message key="core.grid.filter.submit" /></atleap:submit>
                            <atleap:cancel property="clearFilter" styleClass="button"><atleap:message key="core.grid.filter.clear" /></atleap:cancel>
                            <atleap:cancel styleClass="button" onclick="if ( window.opener != null ) { window.opener.focus(); } window.close(); return false;"><atleap:message key="core.grid.filter.cancel" /></atleap:cancel>
                        </td>
                     </tr>
                </table>
                <html:hidden property="fieldName" />
                <html:hidden property="gridName" />
                <html:hidden property="pageUrl" />
                <html:hidden property="fieldKey" />
                <html:hidden property="rowIterators" />
            </atleap:form>
